package text;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class Text_study {
    public static void main(String[] args)throws IOException {
        FileOutputStream fos = new FileOutputStream("C:\\Users\\啦啦啦\\Desktop\\a.txt");
        ObjectOutputStream oos = new ObjectOutputStream(fos);
        oos.writeObject(new Person(" 王狗蛋",18));
        //将Person类的内容写入文件
        oos.close();
    }
}
